Allow dev versions of Docker Compose#594
Conversation
This fixes TibixDev#573. It also would be good practice to support any developers who are genuinely using a bleeding edge version of Docker Compose.
There was a problem hiding this comment.
Pull request overview
This PR adds support for detecting development versions of Docker Compose by recognizing "dev" as a valid version string. This addresses issue #573 and ensures that developers using bleeding-edge Docker Compose builds can use the application.
Key changes:
- Added detection for "dev" version strings in Docker Compose version output
- Development builds are assumed to be v2+ compatible
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (versionMatch) { | ||
| const majorVersion = Number.parseInt(versionMatch[1].split(".")[0], 10); | ||
| specs.dockerComposeInstalled = majorVersion >= 2; | ||
| } else if (dockerComposeOutput.includes("dev")) { |
There was a problem hiding this comment.
The check dockerComposeOutput.includes("dev") is too broad and could produce false positives. For example, it would match "Docker Compose version 2.35.1 - developer edition" or any output containing the substring "dev" anywhere. Consider using a more specific pattern like /version\s+(dev|v?dev)\b/i.test(dockerComposeOutput) to match "dev" only when it appears as a standalone version string.
| } else if (dockerComposeOutput.includes("dev")) { | |
| } else if (/version\s+(dev|v?dev)\b/i.test(dockerComposeOutput)) { |
There was a problem hiding this comment.
I think checking for dev itself is fine, though I'm more than fine with changing that if need be.
There was a problem hiding this comment.
Can we do .endsWith perhaps and see if that still works? Would be a bit cleaner.
|
I think it would be better if the button becomes "continue anyway" and pop up a dialog about potential problems if the version doesn't match. |
| if (versionMatch) { | ||
| const majorVersion = Number.parseInt(versionMatch[1].split(".")[0], 10); | ||
| specs.dockerComposeInstalled = majorVersion >= 2; | ||
| } else if (dockerComposeOutput.includes("dev")) { |
There was a problem hiding this comment.
Can we do .endsWith perhaps and see if that still works? Would be a bit cleaner.
This fixes #573. It also would be good practice to support any developers who are genuinely using a bleeding edge version of Docker Compose.